package motor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JFrame;

public class Inicio extends JFrame implements KeyListener{

	public Inicio() {
		add(PintarEscenario.panel);
		setVisible(true);
		setSize(800, 530);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		addKeyListener(this);
	}

	@Override
	public void keyPressed(KeyEvent e) {
		Controlador ctr = Controlador.getInstance();

		if(e.getKeyCode() == e.VK_RIGHT){
			PintarEscenario.panel.moverStickDerecha();
		}
		
		if(e.getKeyCode() == e.VK_LEFT){
			PintarEscenario.panel.moverStickIzquierda();
		}
		
		
		if(e.getKeyCode() == e.VK_SPACE){
			
			PintarEscenario.panel.disparar();
		}
	}

	@Override
	public void keyReleased(KeyEvent arg0) {

		PintarEscenario.panel.moverDefault();
	}

	@Override
	public void keyTyped(KeyEvent e) {
		
		
	}


	
}
